﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using ProgNetComponentsDx.Language;
using ProgNetComponentsDx.Browsers;

namespace System
{
    public static class DataExt
    {
        public static bool ValidateColUniqueLng(this DataTable table, string col, string[] groupColumns, string errorToSet, string filter, bool onlyModified)
        {
            return table.ValidateColUnique(col, groupColumns, ProgNetLanguage.sGetString(errorToSet, ProgNetLanguage.sGetString(col)), filter, onlyModified);
        }
        public static bool ValidateColUniqueLng(this DataTable table, string col, string[] groupColumns, string errorToSet, string filter)
        {
            return ValidateColUniqueLng(table, col, groupColumns, errorToSet, filter, true);
        }
        public static bool ValidateColUniqueLng(this DataTable table, string col, string[] groupColumns, string errorToSet)
        {
            return ValidateColUniqueLng(table, col, groupColumns, errorToSet, null, true);
        }

        public static bool ValidateColUniqueLng(this DataTable table, string col, string errorToSet, string filter, bool onlyModified)
        {
            return table.ValidateColUnique(col, ProgNetLanguage.sGetString(errorToSet, ProgNetLanguage.sGetString(col)), filter, onlyModified);
        }
        public static bool ValidateColUniqueLng(this DataTable table, string col, string errorToSet, string filter)
        {
            return ValidateColUniqueLng(table, col, errorToSet, filter, true);
        }
        public static bool ValidateColUniqueLng(this DataTable table, string col, string errorToSet)
        {
            return ValidateColUniqueLng(table, col, errorToSet, null, true);
        }

    }
}
